function uplaodAvatar() {
    $("#avatarImage").click();
}

function retrievePersonalInfo() {
    $.ajax({
        url: "/retrieveUserInfo",
        dataType: "json",
        contentType: "application/json;charset=utf-8",
        type: "POST",
        success: function (response) {
            let data = response.data;
            console.log(response);
            $(".avatarUrl").attr("src", data.avatarUrl);
            $(".nickname").text(data.nickname);
            $("#nickname").attr("value", data.nickname);
            $(".level").text("Lv" + data.level);
            let roleName = data.role.id === 1 ? "换宿义工" : "民宿店家";
            $(".role").text(roleName);
            $(".account").attr("value", data.account);
            $("#description").text(data.description);
            $("#userId").attr("value", data.id);
        },
        error: function (error) {
            console.log(error);
        }
    });
}
